/**
 * 
 */
package sopia.sg;

import sopia.conn.DBAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;

/**
 * @author tatsu@gmail.com
 *
 */
public class G007Activity extends Activity  {

	/**
	 * 
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.g007_layout);
		DBAdapter db = new DBAdapter(this);
		//init spinner
//		Spinner unitSpinner = (Spinner) findViewById(R.id.unit_spin);
//		ArrayAdapter adapter = ArrayAdapter.createFromResource(
//		            this, R.array.unit, android.R.layout.simple_spinner_item);
//	    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
//	    unitSpinner.setAdapter(adapter);
		 // screen ID call
		Intent receiveIntent = this.getIntent();
		final String screenID = receiveIntent.getStringExtra("ID");
	    ///back screen
		final ImageButton backImagebutton = (ImageButton) findViewById(R.id.back_imagebutton);
		backImagebutton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = null;
				if("G004".equals(screenID)){
					i = new Intent(G007Activity.this, G004Activity.class);
				}
				i.putExtra("ID", "G007");
//				Bundle sendBundle = new Bundle();
//				sendBundle.putLong("value", receiveValue);
//				i.putExtras(sendBundle);
				startActivity(i);
			}
		});
		
		// add account addAccName_button 
//		final Button addAccButton = (Button) findViewById(R.id.addAccName_button);
//		final EditText nameAccount = (EditText) findViewById(R.id.nameAcc_edit);
//		final EditText amountAccount = (EditText) findViewById(R.id.amountAcc_edit);
//		addAccButton.setOnClickListener(new OnClickListener() {
//			
//			@Override
//			public void onClick(View v) {
//				// TODO Auto-generated method stub
//				String name = nameAccount.getText().toString();
//				int amount =Integer.parseInt(amountAccount.getText().toString());
//				
//				
//			}
//		});
	}

}
